<%@page contentType="text/html;charset=utf-8"%>
<%@page trimDirectiveWhitespaces="true"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="renderer" content="webkit">
<title>${PARAM.project}</title>
<link href="${CTX}/static/img/mgt/core/favicon.ico" rel="shortcut icon">
<link href="${CTX}/static/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="${CTX}/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${CTX}/static/plugins/hplus/css/style.css" rel="stylesheet">
<link href="${CTX}/static/css/mgt/core/main.css" rel="stylesheet">
<link href="${CTX}/static/css/mgt/core/common.css" rel="stylesheet">
<script src="${CTX}/static/plugins/jquery/jquery.min.js"></script>
<script src="${CTX}/static/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="${CTX}/static/plugins/hplus/js/hplus.js"></script>
<script src="${CTX}/static/plugins/hplus/js/contabs.js"></script>
<script src="${CTX}/static/plugins/metisMenu/metisMenu.min.js"></script>
<script src="${CTX}/static/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="${CTX}/static/plugins/layer/layer.js"></script>
<script src="${CTX}/static/plugins/json/json2.js"></script>
<script src="${CTX}/static/plugins/strophe/strophe.min.js"></script>
<script src="${CTX}/static/plugins/date-utils/date-utils.js"></script>
<script src="${CTX}/static/plugins/pace/pace.min.js"></script>
<script src="${CTX}/static/js/mgt/core/common.js"></script>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
	<div id="wrapper">
		<nav class="navbar-default navbar-static-side" role="navigation">
			<div class="nav-close">
				<i class="fa fa-times-circle"></i>
			</div>
			<div class="sidebar-collapse">
				<ul class="nav" id="side-menu">
					<li class="nav-header">
						<div class="dropdown profile-element">${PARAM.project}</div>
						<div class="logo-element">
							<i class="fa fa-desktop"></i>
						</div>
					</li>
				</ul>
			</div>
		</nav>
		<div id="page-wrapper" class="gray-bg dashbard-1">
			<div class="row border-bottom">
				<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
					<div class="navbar-header">
						<a class="navbar-minimalize minimalize-styl-2 btn btn-primary" href="#">
							<i class="fa fa-bars"></i>
						</a>
					</div>
					<ul class="nav navbar-top-links navbar-right">
						<li class="dropdown">
							<a class="dropdown-toggle hidden-xs" data-toggle="dropdown" href="#">
								<span class="fa fa-id-card-o m-r-5"></span>${USER.name}<span class="caret"></span>
							</a>
							<ul class="dropdown-menu dropdown-menu-right">
								<li>
									<a id="info">
										<i class="fa fa-user m-r-10"></i>个人信息
									</a>
								</li>
								<li>
									<a id="password">
										<i class="fa fa-lock m-r-10"></i>修改密码
									</a>
								</li>
							</ul>
						</li>
						<li class="dropdown hidden-xs">
							<a class="right-sidebar-toggle" aria-expanded="false">
								<span class="fa fa-tasks m-r-5"></span>主题<span class="caret"></span>
							</a>
						</li>
						<li class="hidden-xs">
							<a id="exit">
								<span class="fa fa-sign-out m-r-5"></span>退出
							</a>
						</li>
					</ul>
				</nav>
			</div>
			<div class="row content-tabs">
				<button class="roll-nav roll-left J_tabLeft">
					<i class="fa fa-backward"></i>
				</button>
				<nav class="page-tabs J_menuTabs">
					<div class="page-tabs-content">
						<a href="javascript:;" class="active J_menuTab" data-id="home.html">首页</a>
					</div>
				</nav>
				<button class="roll-nav roll-right J_tabRight">
					<i class="fa fa-forward"></i>
				</button>
				<div class="btn-group roll-nav roll-right">
					<button class="dropdown J_tabClose" data-toggle="dropdown">
						关闭操作<span class="caret"></span>
					</button>
					<ul class="dropdown-menu dropdown-menu-right">
						<li class="J_tabShowActive">
							<a>定位当前选项卡</a>
						</li>
						<li class="divider"></li>
						<li class="J_tabCloseAll">
							<a>关闭全部选项卡</a>
						</li>
						<li class="J_tabCloseOther">
							<a>关闭其他选项卡</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="row J_mainContent" id="content-main">
				<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${CTX}/mgt/sys/home/info" frameborder="0" data-id="home.html" seamless></iframe>
			</div>
			<div class="footer">
				<div class="pull-left">© ${PARAM.copyright}</div>
			</div>
		</div>
		<div id="right-sidebar">
			<div class="sidebar-container">
				<div>
					<div class="sidebar-title">
						<h3>
							<i class="fa fa-comments-o m-r-10"></i>主题设置
						</h3>
						<small>你可以从这里选择和预览主题的布局和样式，这些设置会被保存在本地，下次打开的时候会直接应用这些设置。</small>
					</div>
					<div class="skin-setttings">
						<div class="title">主题设置</div>
						<div class="setings-item">
							<span>收起左侧菜单</span>
							<div class="switch">
								<div class="onoffswitch">
									<input type="checkbox" name="collapsemenu" class="onoffswitch-checkbox" id="collapsemenu">
									<label class="onoffswitch-label" for="collapsemenu"><span class="onoffswitch-inner"></span><span class="onoffswitch-switch"></span></label>
								</div>
							</div>
						</div>
						<div class="setings-item">
							<span>固定顶部</span>
							<div class="switch">
								<div class="onoffswitch">
									<input type="checkbox" name="fixednavbar" class="onoffswitch-checkbox" id="fixednavbar">
									<label class="onoffswitch-label" for="fixednavbar"><span class="onoffswitch-inner"></span><span class="onoffswitch-switch"></span></label>
								</div>
							</div>
						</div>
						<div class="setings-item">
							<span>固定宽度 </span>
							<div class="switch">
								<div class="onoffswitch">
									<input type="checkbox" name="boxedlayout" class="onoffswitch-checkbox" id="boxedlayout">
									<label class="onoffswitch-label" for="boxedlayout"><span class="onoffswitch-inner"></span><span class="onoffswitch-switch"></span></label>
								</div>
							</div>
						</div>
						<div class="title">皮肤选择</div>
						<div class="setings-item default-skin nb">
							<span class="skin-name"><a href="#" class="s-skin-0">默认皮肤 </a></span>
						</div>
						<div class="setings-item blue-skin nb">
							<span class="skin-name"><a href="#" class="s-skin-1">蓝色主题 </a></span>
						</div>
						<div class="setings-item yellow-skin nb">
							<span class="skin-name"><a href="#" class="s-skin-3">黄色/紫色主题 </a></span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
	var data = JSON.parse('${USER.menu}');
	var tree = $.toTree(data);
	var menu = '';
	$.each(tree, function(i, node) {
		menu += '<li>';
		menu += '<a href="#">';
		if (node.iconCls) {
			menu += '<i class="' + node.iconCls + '"></i>';
		}
		menu += '<span class="nav-label">' + node.text + '</span><span class="fa arrow"></span></a>';
		if (node.children) {
			menu += '<ul class="nav nav-second-level">';
			$.each(node.children, function(i, node) {
				if (node.children) {
					menu += '<li><a href="#">';
					if (node.iconCls) {
						menu += '<i class="' + node.iconCls + '"></i>';
					}
					menu += node.text;
					menu += '<span class="fa arrow"></span></a>';
					menu += '<ul class="nav nav-third-level">';
					$.each(node.children, function(i, node) {
						if (node.url) {
							if (node.url.substr(0, 4) != "http") {
								node.url = '${CTX}' + node.url;
							}
							menu += '<li><a class="J_menuItem" href="' + node.url + '">';
							if (node.iconCls) {
								menu += '<i class="' + node.iconCls + '"></i>';
							}
							menu += node.text;
							menu += '</a></li>';
						}
					});
					menu += '</ul>';
					menu += '</li>';
				} else {
					if (node.url) {
						if (node.url.substr(0, 4) != "http") {
							node.url = '${CTX}' + node.url;
						}
						menu += '<li><a class="J_menuItem" href="' + node.url + '">';
						if (node.iconCls) {
							menu += '<i class="' + node.iconCls + '"></i>';
						}
						menu += node.text;
						menu += '</a></li>';
					}
				}
			});
			menu += '</ul>';
		}
		menu += '</li>';
	});
	$('#side-menu').append(menu);
</script>
<script>
	$(function() {
		$('.s-skin-0').click(function() {
			if (localStorageSupport) {
				localStorage.setItem('skin_crk', 'skin-0');
			}
		});
		$('.s-skin-1').click(function() {
			if (localStorageSupport) {
				localStorage.setItem('skin_crk', 'skin-1');
			}
		});
		$('.s-skin-3').click(function() {
			if (localStorageSupport) {
				localStorage.setItem('skin_crk', 'skin-3');
			}
		});
		if (localStorageSupport) {
			var skin = localStorage.getItem('skin_crk');
			if(skin){
				$('body').addClass(skin);
			}else{
				$('body').addClass('skin-1');
			}
		}
		$('#info').click(function() {
			var msg = '<div class="info">';
			msg += '<b>账号：</b>${USER.account}<br>';
			msg += '<b>姓名：</b>${USER.name}<br>';
			msg += '<b>机构：</b>${USER.organ.name}<br>';
			if ("${USER.roleName}") {
				msg += '<b>角色：</b>${USER.roleName}<br>';
			}
			msg += '</div>';
			layer.alert(msg, {
				title : $(this).html(),
				closeBtn : 0,
				area : [ '450px', '250px' ]
			});
		});
		$('#password').click(function() {
			$.open({
				title : $(this).html(),
				url : '${CTX}/mgt/core/password',
				width : 450,
				height : 250
			});
		});
		$('#exit').click(function() {
			$.confirm('确定退出系统', function() {
				window.location = '${CTX}/mgt/core/logout';
			});
		});
	});
</script>
</html>